package controller.frontOffice;


import java.io.Serializable;
import java.util.List;
import java.util.Map;

import javax.annotation.PostConstruct;
import javax.ejb.EJB;
import javax.enterprise.context.RequestScoped;
import javax.faces.bean.ManagedBean;
import javax.faces.bean.ManagedProperty;
import javax.faces.bean.ViewScoped;
import javax.faces.context.FacesContext;
import javax.inject.Inject;
import javax.inject.Named;

import org.primefaces.component.menuitem.MenuItem;
import org.primefaces.component.submenu.Submenu;
import org.primefaces.component.tabview.TabView;
import org.primefaces.model.DefaultMenuModel;
import org.primefaces.model.MenuModel;

import controller.backOffice.CategoryController;

import ejb.category.CategoryService;
import ejb.category.CategoryServiceEJB;
import entities.Category;
import entities.Order;


@Named
@RequestScoped
public class MenuController implements Serializable{	

	private static final long serialVersionUID = 1L;

	private Long categoryId;
	
	@EJB 
	private CategoryService categoryService;

	private List<Category> categories;
	
	private Category selectedCategory;

	public void categoriesInit() {
		setSelectedCategory(categoryService.find(categoryId));
	}
	
	public List<Category> getCategories() {
		return categoryService.findAll();
	}

	public void setCategories(List<Category> categories) {
		this.categories = categories;
	}
	
	public Long getCategoryId() {
		return this.categoryId;
	}

	public void setCategoryId(Long categoryId) {
		this.categoryId = categoryId;
	}

	public Category getSelectedCategory() {
		return selectedCategory;
	}

	public void setSelectedCategory(Category selectedCategory) {
		this.selectedCategory = selectedCategory;
	}
}

